/**
 * Author: Lily Jiang
 * Create Time: 2019/9/9
 * Description:
 */

import { lazy } from 'react';

const index = lazy(() => import('../page/index/Index.js'));
const userIndex = lazy(() => import('../page/userIndex/Index.js'));
const articleComments = lazy(() => import('../page/article/articleComments/Index.js'));
const articleDetail = lazy(() => import('../page/article/articleDetail/Index.js'));
const login = lazy(() => import('../page/login/Index.js'));
const message = lazy(() => import('../page/message/Index.js'));
const settings = lazy(() => import('../page/settings/Index.js'));
const userCollect = lazy(() => import('../page/userCollect/Index.js'));
const articleCommentCreate = lazy(() => import('../page/article/articleCommentCreate/Index.js'));

export const router = [
    {
        path: '/',          //  首页
        auth: false,        //  是否校验登录态
        component: index,
        name: 'index',
    },
    {
        path: '/user/index',    //  个人中心首页
        component: userIndex,
        name: 'userIndex',
        auth: true,
    },
    {
        path: '/user/collect',    //  个人中心-我的收藏
        name: 'userCollect',
        auth: true,
        component: userCollect
    },
    {
        path: '/message',    //  消息中心
        name: 'message',
        auth: true,
        component: message,
    },
    {
        path: '/settings',    //  设置
        name: 'settings',
        auth: false,
        component: settings
    },
    {
        path: '/article/detail',    //  文章详情
        name: 'articleDetail',
        auth: false,
        component: articleDetail,
    },
    {
        path: '/article/comments',    //  文章详情-评论列表
        name: 'articleComments',
        auth: false,
        component: articleComments,
    },
    {
        path: '/article/commentCreate',    //  文章详情-评论
        name: 'articleCommentCreate',
        auth: true,
        component: articleCommentCreate,
    },
    {
        path: '/login',    //  登录
        name: 'login',
        auth: false,
        component: login,
    },
]